#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int b;
    scanf("%d", &b);
    int arr[b];
    for (int i = 0; i < b; i++)
    {
        scanf("%d", &arr[i]);
    }
    int tmp = 0;
    for (int j = 0; j < b; j++)
    {
        if (arr[j] > arr[j + 1])
        {
            tmp = 1;
            break;
        }
    }
    if (tmp == 1)
        printf("unsorted");
    else
        printf("sorted");
    return 0;
}